function creatAnimation(options) {
    var from = options.from;
    var to = options.to;
    var totalMs = options.totalMs || 1000; //动画总时长
    var duration = options.duration || 15; //每一帧时长

    var times = Math.floor(totalMs / duration); //变化的总次数
    var dis = (to - from) / times; //每次变化的距离

    var curTimes = 0; //记录当前执行次数；用于判断动画是否该结束

    var timerId = setInterval(function () {
        from += dis;
        options.onmove && options.onmove(from);
        curTimes++;
        if (curTimes >= times) {
            from = to; //变化完成
            clearInterval(timerId);
            options.onend && options.onend();
        }
    }, duration)
}